for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
"use strict";
const sarahClient = require('./client/sarahClient');
const logger = require('./logger');
/**
* Allow call to S.A.R.A.H. client
*/
class Client {
* @public
constructor() {
this.logger = logger;
}
*
* @param {string} textToSpeech
* @returns {Promise<null|Error>}
speak(textToSpeech) {
if (!textToSpeech) {
return Promise.resolve();
this.logger.debug(`Alfred will say "${textToSpeech}"`);
return sarahClient({
tts: textToSpeech,
sync: true
})
.then(() => null)
;
listen() {
return sarahClient({'listen': true})
.then(() => null);
stopListening() {
return sarahClient({'listen': false})
module.exports = Client;